﻿using System.Text.Json.Serialization;

namespace fCloud.SensorApi.Models;

public class ReportData
{
    [JsonPropertyName("method")]
    public string Method { get; set; }

    [JsonPropertyName("report_type")]
    public int ReportType { get; set; }

    [JsonPropertyName("data")]
    public SensorDataT Data { get; set; } = new();
}

public class SensorDataT
{
    [JsonPropertyName("mac")]
    public string Mac { get; set; } = string.Empty;

    [JsonPropertyName("statusCode")]
    public string StatusCode { get; set; } = string.Empty;

    [JsonPropertyName("daq_time")]
    public long DaqTime { get; set; }

    [JsonPropertyName("data_list")]
    public List<DataPoint> DataList { get; set; } = new();
}

public class DataPoint
{
    [JsonPropertyName("key")]
    public string Key { get; set; } = string.Empty;

    [JsonPropertyName("data")]
    public string Data { get; set; } = string.Empty;
}

public class RecordData
{
    public ReportData ReportData { get; set; }
    public Sensor SensorInfo { get; set; }
}